<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>Document</title>
    <link rel="icon" href="atk_logo.ico">
    <link rel="stylesheet" href="./PIT.css"/>
    <style>
    html,
    body {
      height: 100%;
      width: 100%;
    }

    * {
      margin: 0;
      padding: 0;
    }

    #app {
      width: 100%;
      height: 100%;
      display: flex;
    }

    .pit-bimwin {
      flex: 1;
      height: 100%;
      position: relative;
      border: 0px solid #000;
      box-sizing: border-box;
    }

    .hide_btn {
      position: fixed;
      top: 10px;
      left: 50%;
      z-index: 1;
      border: none;
      padding: 2px 10px;
      border-radius: 10px;
      cursor: pointer;
    }

    .container {
      width: 100%;
      height: 100%;
      display: inline-flex;
      flex-wrap: wrap;
    }

    .container>div {
      flex: 1;
      flex-basis: 50%;
    }

    .container .split {
      flex: 1;
      flex-basis: 50%;
      height: 50%;
    }

    </style>
</head>

<body>
<div id="app">
    <div class="container" v-if="options.fileId">
        <pit-bim-win-ui :options="options" :headers="headers">
        </pit-bim-win-ui>
    </div>
</div>
</body>
<script src="./vue.js"></script>
<script src="./PIT.umd.min.js"></script>
<script>
  var vm = new Vue({
    el: '#app',
    data() {
      return {
        options: {
          url: "",
          fileId: "",
          apiVersion: 2
        },
        headers: {
          token: "",
        },
      }
    },
    mounted() {
      // this.$set(this.options, 'fileId', ['93d0f57ccc0140c99835e0af35850e90'])
      // let documentObj = {
      //     url: "http://172.18.1.72:9983/",
      //     token: "0e8d286ecfa84f01a97c7733b8aeb4a2dt3xrlvrghl",
      //     fileId: ['93d0f57ccc0140c99835e0af35850e90']
      //   };
      // this.previewModel(JSON.stringify(documentObj));
    },
    methods: {
        // 预览模型的方法
        previewModel() {
<!--          let documentObj = JSON.parse(data);-->
<!--          let options = {-->
<!--              url: documentObj.url,-->
<!--              fileId: documentObj.fileId,-->
<!--            };-->
<!--          this.options = options;-->
<!--          this.headers.token = documentObj.token-->

      },
    }
  })
function previewModel(token,url,fileId) {
<!--alert(token)-->
<!--      vm._data.headers.token = "0e8d286ecfa84f01a97c7733b8aeb4a2dt3xrlvrghl";-->
<!--      vm._data.options.url = "http://172.18.1.72:9983/";-->
<!--      vm._data.options.fileId = ['93d0f57ccc0140c99835e0af35850e90'];-->

      vm._data.headers.token = token;
      vm._data.options.url = url;
      vm._data.options.fileId = fileId;
  }
<!--  previewModel()-->

</script>

</html>